<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
</head>
<body>
	<div>
		<p></p>
		<!-- this is 注释节点 -->
	</div>

	<script>
		//遍历节点树
		var div = document.getElementsByTagName('div')[0];
		var nodes = div.childNodes;
		Object.prototype.nodesTree = function () {
				var len = nodes.length;
			for(var i = 0;i < len;i ++){
				console.log(nodes[i]);
			}

		
		}
		
		
		
	</script>
</body>
</html>